import java.util.Arrays;

public class BubbleSort {
    public static void BubbleSort(int[] arr) {
        for (int i = arr.length - 1; i >=0; i--) {
            for(int j = 0; j < i; j++) {
                if(arr[j] > arr[j+1]) {
                    int temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
    public static void main(String[] args) {
        int[] arr=new int[]{23,67,90,24,8,53,20};
        BubbleSort(arr);
    }
}
